<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>乡土味士 - 后台管理中心 - 分类列表</title>
    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="__PUBLIC__/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style.min862f.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox-title" style="min-height: 65px;margin-bottom: 15px;">
                <h5>
                    <a href="<?=U('Category/index')?>" title="分类列表">
                        <button type="button" class="btn btn-primary">分类列表</button>
                    </a>
                    <a href="<?=U('Category/addCate')?>" title="添加分类">
                        <button type="button" class="btn btn-primary">+添加分类</button>
                    </a>
                </h5>
            </div>
            <div class="ibox-content">
                <table class="table table-striped table-bordered table-hover dataTables-example">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>分类名称</th>
                            <th>排序</th>
                            <th>类型</th>
                            <th>是否为前台</th>
                            <!--<th>状态</th>-->
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <volist name="list" id="vo"> <!--一级栏目循环开始-->
                        <tr class="gradeX">
                            <td>{$vo.id}</td>
                            <td>{$vo.title}</td>
                            <td>{$vo.displayorder}</td>
                            <td>
                                <switch name="vo.type">
                                    <case value="1">文章</case>
                                    <case value="2">商品</case>
                                    <case value="3">单页</case>
                                </switch>
                            </td>
                            <td>
                                <switch name="vo.is_home">
                                    <case value="0">后台</case>
                                    <case value="1">前台</case>
                                </switch>
                            </td>
                            <td>
                                <a href="<?=U('Category/addCate',['id'=>$vo['id']])?>" style="padding:0 3px;" title="编辑">
                                    <i class="glyphicon glyphicon-pencil"></i>
                                </a>
                                <a href="javascript:;" style="padding:0 3px;" class="js_del" data-id="{$vo.id}" title="删除">
                                    <i class="glyphicon glyphicon-trash"></i>
                                </a>
                            </td>
                        </tr>
                            <notempty name="vo['_child']">
                                <volist name="vo['_child']" id="v"> <!--二级栏目循环开始-->
                                    <tr class="gradeX">
                                        <td>{$v.id}</td>
                                        <td><span style="color:#1ab394;font-weight: bold;"> &nbsp;&nbsp;- - </span> {$v.title}</td>
                                        <td>{$v.displayorder}</td>
                                        <td>
                                            <switch name="v.type">
                                                <case value="1">文章</case>
                                                <case value="2">商品</case>
                                                <case value="3">单页</case>
                                            </switch>
                                        </td>
                                        <td>
                                            <switch name="v.is_home">
                                                <case value="0">后台</case>
                                                <case value="1">前台</case>
                                            </switch>
                                        </td>
                                        <td>
                                            <a href="<?=U('Category/addCate',['id'=>$v['id']])?>" style="padding:0 3px;" title="编辑">
                                                <i class="glyphicon glyphicon-pencil"></i>
                                            </a>
                                            <a href="javascript:;" style="padding:0 3px;" class="js_del" data-id="{$v.id}" title="删除">
                                                <i class="glyphicon glyphicon-trash"></i>
                                            </a>
                                        </td>
                                    </tr>

                                    <notempty name="v['_child']">
                                        <volist name="v['_child']" id="val"> <!--三级栏目循环开始-->
                                            <tr class="gradeX">
                                                <td>{$val.id}</td>
                                                <td><span style="color:#1ab394;font-weight: bold;">&nbsp; &nbsp;&nbsp;&nbsp;- - - </span> {$val.title}</td>
                                                <td>{$val.displayorder}</td>
                                                <td>
                                                    <switch name="val.type">
                                                        <case value="1">文章</case>
                                                        <case value="2">商品</case>
                                                        <case value="3">单页</case>
                                                    </switch>
                                                </td>
                                                <td>
                                                    <switch name="val.is_home">
                                                        <case value="0">后台</case>
                                                        <case value="1">前台</case>
                                                    </switch>
                                                </td>
                                                <td>
                                                    <a href="<?=U('Category/addCate',['id'=>$val['id']])?>" style="padding:0 3px;" title="编辑">
                                                        <i class="glyphicon glyphicon-pencil"></i>
                                                    </a>
                                                    <a href="javascript:;" style="padding:0 3px;" class="js_del" data-id="{$val.id}" title="删除">
                                                        <i class="glyphicon glyphicon-trash"></i>
                                                    </a>
                                                </td>
                                            </tr>
                                        </volist> <!--三级栏目循环结束-->

                                    </notempty>

                                </volist><!--二级栏目循环结束-->
                            </notempty>
                        </volist> <!--一级栏目循环结束-->
                    </tbody>
                    <tfoot>
                        <tr>
                            <th>序号</th>
                            <th>分类名称</th>
                            <th>排序</th>
                            <th>类型</th>
                            <th>是否为前台</th>
                            <!--<th>状态</th>-->
                            <th>操作</th>
                        </tr>
                    </tfoot>
                </table>

                <!--分页-->
                <!--<div class="footer">-->
                    <!--{$page}-->
                <!--</div>-->
            </div>
        </div>
        </div>
    </div>
</div>

<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/js/plugins/jeditable/jquery.jeditable.js"></script>
<script src="__PUBLIC__/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="__PUBLIC__/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="__PUBLIC__/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>

<style type="text/css">
    .footer{
        text-align: center;
    }
    .footer a{
        width: 58px;
        height: 20px;
        display: inline-block;
        border: 1px solid #d2d2d2;
        margin-left: 2px;
    }
    .footer span{
        width: 58px;
        height: 20px;
        display: inline-block;
        margin-left: 2px;
    }
    .footer .current{
        background-color: #f4f4f4;
        border: 1px solid #d2d2d2;
    }
</style>

<script>

    $(document).ready(function(){
        $(".dataTables-example").dataTable();
        var oTable=$("#editable").dataTable();
        oTable.$("td").editable("http:///theme/example_ajax.php",{
            "callback":function(sValue,y){
                var aPos=oTable.fnGetPosition(this);
                oTable.fnUpdate(sValue,aPos[0],aPos[1])},
            "submitdata":function(value,settings){
                return{"row_id":this.parentNode.getAttribute("id"),"column":oTable.fnGetPosition(this)[2]}},"width":"90%","height":"100%"
        })
    });

    //删除
    $(".js_del").click(function () {
        var id = $(this).attr('data-id');
        var status = -1;
        var i = layer.load();
        var this_a = $(this);
        $.post('<?=U("Category/del_cate")?>',{id:id,status:status},function(e){
            layer.close(i);
            if(e.status==1){
                this_a.parent().parent(".gradeX").remove();
                // window.location.reload();
            }else{
                layer.msg(e.msg,{icon:2});
            }
        });
    })

</script>

</body>


<!-- Mirrored from /theme/hplus/table_jqgrid.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:02 GMT -->
</html>
